package concurrent.push;

/**
 * Author: Jason Wu
 * Date  : 2013-12-19
 */
public abstract class PushingTask extends Thread {
    protected volatile boolean cancelled = false;

    protected boolean cancel() {
        cancelled = true;
        return cancelled;
    }

    protected boolean isCancelled() {
        return cancelled;
    }

    protected abstract void push(int index);

    protected abstract String getKey();
}
